package com.java.collection.list;

import java.util.LinkedList;

/**
 * 利用LinkedList集合自定义栈集合
 * @author LC
 *
 */
public class MyStack {
	
	private LinkedList link ;

	public MyStack() {
		link = new LinkedList() ;
	}
	
	public void push(Object obj) {
		link.addFirst(obj) ;
	} 
	
	public Object peek() {
		return link.getFirst() ;
	}
	
	public Object pop() {
		return link.removeFirst() ;
	}
	
	public Object remove() {
		return link.removeFirst() ;
	}
	
	public boolean isEmpty() {
		return link.isEmpty() ;
	}

}
